home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 86
/
(Vol 86) My Disc.iso
/
Games
/
moda_1230.swf
/
scripts
/
frame_3
/
DoAction.as
Wrap
Text File
|
2009-04-23
|
11KB
|
425 lines
function vcble()
{
var i = 1;
while(i <= brushes)
{
eval("brush" + i)._visible = false;
i++;
}
erase._visible = bottle._visible = colorpallete._visible = false;
ok._visible = spray._visible = false;
}
stop();
var X = new Array();
var Y = new Array();
var Z = new Array();
var thank = 0;
var dress = 97;
var brushes = 10;
var val = 150;
var count = 0;
var depth = 0;
var d = 0;
var a = 0;
var img = 0;
var colorstored;
var defaltBrush = "yes";
var defalt = "yes";
var Open = "yes";
var Mask = "No";
var brushstart = "no";
newcolorplt._visible = thanks._visible = false;
eval("v" + [dress + 1]).hair.onPress = function()
{
d++;
d != 4 ? "" : (d = 0);
this.gotoAndStop(d + 1);
};
vcble();
signhead._visible = goback._visible = namehead._visible = txtimg._visible = textbg._visible = input._visible = next_btn.enabled = false;
resetbtn.onRollOver = next_btn.onRollOver = goback.onRollOver = playagain.onRollOver = ok.onRollOver = function()
{
this.gotoAndPlay(2);
Mask = "Yes";
};
resetbtn.onRollOut = next_btn.onRollOut = goback.onRollOut = playagain.onRollOut = ok.onRollOut = function()
{
this.gotoAndPlay(11);
if(a != 3)
{
Mask = "No";
}
};
var i = 1;
while(i <= dress)
{
X[i] = getProperty(eval("v" + i), _X);
Y[i] = getProperty(eval("v" + i), _Y);
Z[i] = eval("v" + i).getDepth(i);
eval("v" + i).onPress = function()
{
startDrag(this,0);
this.swapDepths(depth++);
updateAfterEvent();
this.ind != 1 ? "" : (this.ind = undefined);
};
eval("v" + i).onRelease = eval("v" + i).onReleaseOutside = function()
{
this.stopDrag();
delete onMouseMove;
if(this.hitTest(hit))
{
this.ind = 1;
}
};
i++;
}
this.onEnterFrame = function()
{
if(eval("v" + [dress + 1]).mouth.hitTest(_xmouse,_ymouse,false))
{
eval("v" + [dress + 1]).mouth.play(1);
if(thank)
{
thanks._visible = true;
thanks.play();
}
}
if(eval("v" + [dress + 1]).chest.hitTest(_xmouse,_ymouse,true))
{
eval("v" + [dress + 1]).mouth.gotoAndStop(5);
eval("v" + [dress + 1]).chest.onPress = function()
{
eyeR.eyeballR._x += 3;
eyeL.eyeballL._x += 3;
eyeL.eyeballL._xscale = eyeR.eyeballR._xscale = val + 100;
eyeL.eyeballL._yscale = eyeR.eyeballR._yscale = val + 100;
};
eval("v" + [dress + 1]).chest.onRelease = eval("v" + [dress + 1]).chest.onReleaseOutside = function()
{
eyeR.eyeballR._x -= 3;
eyeL.eyeballL._x -= 3;
eyeL.eyeballL._xscale = eyeR.eyeballR._xscale = 92.1;
eyeL.eyeballL._yscale = eyeR.eyeballR._yscale = 92.1;
};
}
radian = Math.atan2(_ymouse - eyeL._y,_xmouse - eyeL._x);
degree = Math.round(radian * 180 / 3.141592653589793);
eyeL._rotation = eyeR._rotation = degree - 160;
i = 1;
while(eval("v" + i).ind != 1 && i <= dress)
{
i++;
}
if(i > dress)
{
next_btn.enabled = false;
}
else
{
next_btn.enabled = true;
}
};
ok.onPress = function()
{
thank++;
eval("v" + [dress + 1]).hair.enabled = false;
eyeL._visible = eyeR._visible = nose._visible = true;
a++;
newcolorplt._visible = false;
signhead._visible = playagain._visible = true;
spray._visible = next_btn._visible = txtimg._visible = name = goback._visible = input._visible = ok._visible = false;
Open = "yes";
eval("v" + [dress + 1])._visible = true;
playagain._x = goback._x;
playagain._y = goback._y;
_root.sign.output = input.text;
var i = 1;
while(i <= brushes)
{
eval("brush" + i)._visible = false;
var my = new Color(eval("brush" + i));
my.setRGB(0);
i++;
}
vcble();
var i = 1;
while(i <= dress)
{
if(eval("v" + i).ind == 1)
{
eval("v" + i)._visible = true;
eval("v" + i).enabled = false;
}
i++;
}
};
goback.onRelease = function()
{
a--;
if(a == 1)
{
newcolorplt._visible = false;
brushstart = "no";
txtimg._visible = Board._visible = false;
textbg._visible = namehead._visible = input._visible = next_btn._visible = true;
vcble();
}
if(a == 0)
{
eyeL._visible = eyeR._visible = nose._visible = true;
img = 0;
brushstart = "no";
Open = "yes";
name = false;
var j = 0;
while(j <= brushes)
{
var i = 0;
while(i <= count)
{
removeMovieClip(eval("Board.brush" + j + i));
i++;
}
var my = new Color(eval("brush" + j));
my.setRGB(0);
j++;
}
namehead._visible = ok._visible = goback._visible = input._visible = false;
textbg._visible = spray._visible = colorpallete._visible = false;
resetbtn._visible = true;
resetbtn._x = goback._x;
resetbtn._y = goback._y;
var i = 0;
while(i <= dress + 2)
{
eval("v" + i)._visible = true;
i++;
}
}
};
resetbtn.onRelease = function()
{
eval("v" + [dress + 1]).hair.gotoAndStop(1);
Open = "yes";
img = 0;
var i = 1;
while(i <= brushes)
{
var my = new Color(eval("brush" + i));
my.setRGB(0);
i++;
}
next_btn.enabled = false;
var i = 1;
while(i <= dress)
{
setProperty(eval("v" + i), _Y, Y[i]);
setProperty(eval("v" + i), _X, X[i]);
eval("v" + i).swapDepths(Z[i]);
eval("v" + i).ind = undefined;
i++;
}
};
next_btn.onRelease = function()
{
a++;
goback._visible = true;
if(a == 1)
{
eyeL._visible = eyeR._visible = nose._visible = false;
namehead._visible = textbg._visible = input._visible = true;
input.text = "";
var i = 1;
while(i <= dress + 1)
{
eval("v" + i)._visible = false;
i++;
}
resetbtn._visible = false;
}
if(a == 2)
{
newcolorplt._visible = true;
newcolorplt.colourpicker.cp_button.enabled = false;
newcolorplt.colourpicker.cp_button2.enabled = false;
img++;
name = false;
Board._visible = true;
var i = 1;
while(i <= brushes)
{
eval("newcolorplt.v" + i).onRollOver = function()
{
Mask = "yes";
};
eval("newcolorplt.v" + i).onRollOut = function()
{
Mask = "No";
};
eval("brush" + i)._visible = true;
eval("brush" + i).enabled = false;
eval("brush" + i).onRelease = function()
{
buttonname = this._name;
name = this._name.substr(5);
};
i++;
}
img != 1 ? (txtimg._visible = false) : (txtimg._visible = true);
ok._visible = colorpallete._visible = true;
next_btn._visible = textbg._visible = namehead._visible = input._visible = false;
erase._visible = bottle._visible = true;
_root.sign.output = "";
bottle.onPress = function()
{
function spraying()
{
count++;
if(Mask == "No" && brushstart == "yes")
{
if(defaltBrush == "yes")
{
buttonname = "brush6";
Board.attachMovie("library6",buttonname + count,count);
}
else
{
Board.attachMovie("library" + name,buttonname + count,count);
}
}
Board[buttonname + count]._x = _xmouse;
Board[buttonname + count]._y = _ymouse;
var _loc2_ = new Color(Board[buttonname + count]);
if(Open == "yes")
{
_loc2_.setRGB(0);
}
else
{
Open = "no";
_loc2_.setRGB(_root.colorstored);
}
}
newcolorplt.colourpicker.cp_button.enabled = true;
newcolorplt.colourpicker.cp_button2.enabled = true;
brushstart = "yes";
defaltBrush = "yes";
txtimg._visible = false;
startDrag(spray,0);
spray._visible = true;
spray._x = _xmouse;
spray._y = _ymouse;
var i = 1;
while(i <= brushes)
{
eval("brush" + i).enabled = true;
i++;
}
newcolorplt.trans1.onRollOver = function()
{
Mask = "yes";
};
newcolorplt.trans1.onRollOut = function()
{
Mask = "No";
};
colorpallete.trans.onRollOver = function()
{
Mask = "yes";
};
colorpallete.trans.onRollOut = function()
{
Mask = "No";
};
onMouseDown = function()
{
if(name)
{
defaltBrush = "no";
}
if(a == 2)
{
spraying();
}
onMouseMove = function()
{
updateAfterEvent();
if(a == 2)
{
spraying();
}
};
};
};
onMouseUp = function()
{
delete this.onMouseMove;
};
erase.onRelease = function()
{
var j = 1;
while(j <= brushes)
{
var i = 1;
while(i <= count)
{
removeMovieClip(eval("Board.brush" + j + i));
i++;
}
j++;
}
};
}
};
i = 1;
while(i <= 10)
{
bottle.onRollOver = eval("brush" + i).onRollOver = function()
{
Mask = "Yes";
};
bottle.onRollOut = eval("brush" + i).onRollOut = function()
{
Mask = "No";
};
i++;
}
playagain.onRelease = function()
{
thank = 0;
eval("v" + [dress + 1]).hair.enabled = true;
eval("v" + [dress + 1]).hair.gotoAndStop(1);
eval("v" + [dress + 1]).mouth.gotoAndStop(1);
_root.thanks._visible = false;
_root.v98.mouth.gotoAndStop(1);
brushstart = "no";
signhead._visible = thanks._visible = false;
img = 0;
a = 0;
next_btn.enabled = playagain._visible = colorpallete._visible = false;
resetbtn._visible = next_btn._visible = true;
_root.sign.output = "";
var j = 1;
while(j <= brushes)
{
i = 1;
while(i <= count)
{
removeMovieClip(eval("Board.brush" + j + i));
i++;
}
j++;
}
var i = 1;
while(i <= dress)
{
eval("v" + i).ind = undefined;
eval("v" + i)._visible = eval("v" + i).enabled = true;
setProperty(eval("v" + i), _Y, Y[i]);
setProperty(eval("v" + i), _X, X[i]);
eval("v" + i).swapDepths(Z[i]);
i++;
}
};